/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Marcelo
 */
public class ProgramaConfig {


    static public String read(String propiedad)
    {
        InputStream is = null;
        try {
            Properties prop = new Properties();
            String fileName = "db.config";
            is = new FileInputStream(fileName);
            prop.load(is);
            return prop.getProperty(propiedad,"");
            /*System.out.println(prop.getProperty(propiedad, ""));
            System.out.println(prop.getProperty(propiedad, ""));
            System.out.println(prop.getProperty(propiedad, ""));
            
            return "";*/
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ProgramaConfig.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(ProgramaConfig.class.getName()).log(Level.SEVERE, null, ex);
        }  finally {
            try {
                is.close();
            } catch (IOException ex) {
                Logger.getLogger(ProgramaConfig.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return "";
    }
    
}
